<?php

namespace App\Manage;


use App\Models\Admin;
use App\Models\AdminLog;

class AdminLogManage extends Manage
{

    // 日志

    // 模型
    protected function getModel()
    {
        return new AdminLog();
    }

    // 整理列表数据
    protected function _afterList($list)
    {
        if(empty($list)){
            return $list;
        }

        $uids   = array_column($list, 'uid');
        $admins = (new Admin())->getListInIdsCache($uids);
        foreach($list as &$_row){
            $_row['admin'] = $admins[$_row['uid']] ?? [];
        }

        return $list;
    }
}

